package com.blb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blb.entity.Company;
import com.blb.entity.Par;
import com.blb.entity.Product;
import com.blb.entity.Relation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CustomerMapper extends BaseMapper<Relation> {
    /*
    * 所有客户
    *
    * */
    List<Relation> CustomerCompany(@Param("start") int start, @Param("length") int length,@Param("companyId") String companyId, @Param("companyProvince") String companyProvince, @Param("companyCity") String companyCity, @Param("companyArea") String companyArea, @Param("companyName") String companyName);

    /**
     * 计算数据总数
     * @param companyProvince
     * @param companyCity
     * @param companyArea
     * @param companyName
     * @return
     */
    int count(@Param("companyId") String companyId,@Param("companyProvince") String companyProvince, @Param("companyCity") String companyCity, @Param("companyArea") String companyArea, @Param("companyName") String companyName);

    /**
     * 根据客户id查询企业用户
     * @param companyId
     * @return
     */
    Relation findByCompanyId(String companyId);

    /*
    * 所有注册公司信息
    * */
    List<Company>  allCompany (@Param("start") int start, @Param("length") int length,@Param("companyId") String companyId, @Param("companyName") String companyName, @Param("companyBrand") String companyBrand );


    int count2(@Param("companyId") String companyId,@Param("companyName") String companyName,@Param("companyBrand") String companyBrand);
   /*
   * 修改备注
   * */
    void updateCompany(@Param("rRemark") String rRemark,@Param("companyId") String companyId);


    void addCustomer(Company company);


    void addRelation(Relation relation);


    void addPar(Par par);

    List<Map<String,Object>> findAllOrderList( @Param("customerId") String customerId, @Param("supplierId") String supplierId);



    /**
     * 获取客户企业对应商品信息
     * @param ids
     * @param companyId
     * @param start
     * @param length
     * @return
     */
    List<Product> getCustomerCompanyProductInfo(@Param("ids") List<String> ids, @Param("companyId") String companyId, int start, int length);


    /**
     * 计算获取客户企业对应商品信息数据
     * @param ids
     * @param companyId
     * @return
     */
    int count3 (@Param("ids") List<String> ids, @Param("companyId") String companyId);

}
